﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta http-equiv="Expires" CONTENT="0">
    <meta http-equiv="Cache-Control" CONTENT="no-cache">
    <meta http-equiv="Pragma" CONTENT="no-cache">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <meta name="description" content="">
    <meta name="keywords" content="0">
    <title>伯虎物联</title>
	<link rel="stylesheet" href="${s.base}/mobile/css/style.css">
	<link rel="stylesheet" href="${s.base}/js/layui/css/layui.css" media="all" />
	<script type="text/javascript" src="${s.base}/mobile/js/jquery.min.js"></script>
	<script type="text/javascript" src="${s.base}/jslayui/layui.js"></script>
    <style type="text/css">

               body {
	           
                        background:#0099cc;
                        width:100%; 
                        height:100%; 
                   
                    }

		#head{width: 96%;height: 80px;margin-left: 2%;}
		#head ul{width: 100%;}
		#head ul li{float: left;line-height: 80px;}
		#head ul .title{width: 50%; text-align: center;font-size: 30px;color:#ffffff;font-weight: bold;}
		#head ul .btn{width: 50%; text-align: right;line-height: 80px;}
		#head ul .btn input{float: right; margin-right: 5%; width: auto; height: 36px; margin-top: 22px;font-size: 18px;color:#ffffff;}
		#content{width: 92%;margin-left: 4%;}
		#content ul{width: 100%;}
		#content ul li{width: 100%; text-align: center;clear: both;}
		#content ul .content_top{ text-align: left;float: left;}
		#content ul .content_show img{width: 90%; text-align: center;}
		.line40{line-height:40px}
		.line80{line-height:80px}
		.line140{line-height:140px}
		.font1{font-size: 18px;color: #ffffff;}
		.font2{font-size: 20px;color: #ffffff;}
		.font3{font-size: 14px;}
		.select{line-height: 30px;font-size: 15px;border-radius: 5px; padding-left: 10px;margin-left: 5px;}
		.input{line-height: 34px;font-size: 15px;border-radius: 5px; padding-left: 10px;margin-left: 5px;width: 40px; border: 0px;}
		.text_align_left{text-align: left;}
		.text_align_right{text-align: right;}
		.blank{color: #ffffff;}
		.red{color:#FF0000;}
		.org{color:#F77303;}
		.gree{color:#9AFC02;}
		.margin-left1{margin-left: 40px;}
	</style>
</head>

<body style="max-width:640px;">
   <!--<div style="position:absolute; width:100%; height:100%; z-index:-1"> 
	<img style="position:fixed;" src="${s.base}/mobile/img/head-bg.png" height="100%" width="100%" />
   </div>-->
  
  <div id="head">
  	<ul>
  		<li class="title">
  			伯虎物联1
  		</li>
  		<li class="btn">
  			<input type="button" onClick="window.location.href='/phone/relay/${openid}?relayEntityId=${relayEntityId}'" class="layui-btn layui-btn-radius layui-btn-normal" value="返回"/>
 		</li>
  	</ul>
  </div>
   <input type="hidden" value="${relaySet.id}"  id="id"/>
   <input type="hidden" value="${relaySet.relayId}"  id="relayId"/>
   <div id="content">
  	<ul>
  		<li class="line40">
  			<div class="font2 content_top line40">
  				联动检测仪ID:
  			</div>
  			<input type="text" id="monId" name="monId" value="${relaySet.monId}"  style="line-height: 34px;font-size: 15px;border-radius: 5px; padding-left: 10px;margin-left: 5px;" class="content_top">
  		</li>
  		<li class="line40">
  			<div class="font2 content_top line40">
  				联动规则设置:
  			</div>
  		</li>
  		<li class="line40">
  			<hr>
  		</li>
  		<li class="line40 margin-left1">
  			<div class="font2 content_top line40">
  				一档：
  			</div>
			<select id="type_1" class="content_top select">
				<option <#if relaySet.type_1=="PM2.5">selected</#if> value="PM2.5">PM2.5</option>
				<option <#if relaySet.type_1=="PM1">selected</#if> value="PM1">PM1</option>
				<option <#if relaySet.type_1=="PM10">selected</#if> value="PM10">PM10</option>
				<option <#if relaySet.type_1=="CO2">selected</#if> value="CO2">CO2</option>
				<option <#if relaySet.type_1=="HCHO">selected</#if> value="HCHO">HCHO</option>
				<option <#if relaySet.type_1=="TVOC">selected</#if> value="TVOC">TVOC</option>
				<option <#if relaySet.type_1=="TEMP">selected</#if> value="TEMP">TEMP</option>
				<option <#if relaySet.type_1=="HIM">selected</#if> value="HIM">HUM</option>
				<option <#if relaySet.type_1=="AQI">selected</#if> value="AQI">AQI</option>
				<option <#if relaySet.type_1=="O2">selected</#if> value="O2">O2</option>
			</select>
  			<div class="font2 content_top line40" style="padding: 0px 5px;">
  				>
  			</div>
  			<input type="text" id="num_1" name="num_1" value="${relaySet.num_1}" class="content_top input">
  		</li>
  		<li class="line40">
  			<hr>
  		</li>
  		<li class="line40 margin-left1">
  			<div class="font2 content_top line40">
  				二档：
  			</div>
			<select id="type_2" class="content_top select">
				<option <#if relaySet.type_2=="PM2.5">selected</#if> value="PM2.5">PM2.5</option>
				<option <#if relaySet.type_2=="PM1">selected</#if> value="PM1">PM1</option>
				<option <#if relaySet.type_2=="PM10">selected</#if> value="PM10">PM10</option>
				<option <#if relaySet.type_2=="CO2">selected</#if> value="CO2">CO2</option>
				<option <#if relaySet.type_2=="HCHO">selected</#if> value="HCHO">HCHO</option>
				<option <#if relaySet.type_2=="TVOC">selected</#if> value="TVOC">TVOC</option>
				<option <#if relaySet.type_2=="TEMP">selected</#if> value="TEMP">TEMP</option>
				<option <#if relaySet.type_2=="HIM">selected</#if> value="HIM">HUM</option>
				<option <#if relaySet.type_2=="AQI">selected</#if> value="AQI">AQI</option>
				<option <#if relaySet.type_2=="O2">selected</#if> value="O2">O2</option>
			</select>
  			<div class="font2 content_top line40" style="padding: 0px 5px;">
  				>
  			</div>
			<input type="text" id="num_2" name="num_2" value="${relaySet.num_2}" class="content_top input">
  		</li>
  		<li class="line40">
  			<hr>
  		</li>
  		<li class="line40 margin-left1">
  			<div class="font2 content_top line40">
  				三档：
  			</div>
			<select id="type_3" class="content_top select">
				<option <#if relaySet.type_3=="PM2.5">selected</#if> value="PM2.5">PM2.5</option>
				<option <#if relaySet.type_3=="PM1">selected</#if> value="PM1">PM1</option>
				<option <#if relaySet.type_3=="PM10">selected</#if> value="PM10">PM10</option>
				<option <#if relaySet.type_3=="CO2">selected</#if> value="CO2">CO2</option>
				<option <#if relaySet.type_3=="HCHO">selected</#if> value="HCHO">HCHO</option>
				<option <#if relaySet.type_3=="TVOC">selected</#if> value="TVOC">TVOC</option>
				<option <#if relaySet.type_3=="TEMP">selected</#if> value="TEMP">TEMP</option>
				<option <#if relaySet.type_3=="HIM">selected</#if> value="HIM">HUM</option>
				<option <#if relaySet.type_3=="AQI">selected</#if> value="AQI">AQI</option>
				<option <#if relaySet.type_3=="O2">selected</#if> value="O2">O2</option>
			</select>
  			<div class="font2 content_top line40" style="padding: 0px 5px;">
  				>
  			</div>
			<input type="text" id="num_3" name="num_3" value="${relaySet.num_3}" class="content_top input">
  		</li>
  		<li class="line40">
  			<hr>
  		</li>
  		<li class="line40 margin-left1">
  			<div class="font2 content_top line40">
  				四档：
  			</div>
			<select id="type_4" class="content_top select">
				<option <#if relaySet.type_4=="PM2.5">selected</#if> value="PM2.5">PM2.5</option>
				<option <#if relaySet.type_4=="PM1">selected</#if> value="PM1">PM1</option>
				<option <#if relaySet.type_4=="PM10">selected</#if> value="PM10">PM10</option>
				<option <#if relaySet.type_4=="CO2">selected</#if> value="CO2">CO2</option>
				<option <#if relaySet.type_4=="HCHO">selected</#if> value="HCHO">HCHO</option>
				<option <#if relaySet.type_4=="TVOC">selected</#if> value="TVOC">TVOC</option>
				<option <#if relaySet.type_4=="TEMP">selected</#if> value="TEMP">TEMP</option>
				<option <#if relaySet.type_4=="HIM">selected</#if> value="HIM">HUM</option>
				<option <#if relaySet.type_4=="AQI">selected</#if> value="AQI">AQI</option>
				<option <#if relaySet.type_4=="O2">selected</#if> value="O2">O2</option>
			</select>
  			<div class="font2 content_top line40" style="padding: 0px 5px;">
  				>
  			</div>
			<input type="text" id="num_4" name="num_4" value="${relaySet.num_4}" class="content_top input">
  		</li>
		<li class="line40">
  			<hr>
  		</li>
  		<li class="line40">
  			<div class="font2 content_top line40">
  				档位参数设置:<span class="font3 red">(继电器输出无需设置档位参数)</span>
  			</div>
  		</li>
  		<li class="line40">
  			<hr>
  		</li>
  		<li class="line40 margin-left1">
  			<div class="content_top" style="width: 45%;">
  			<div class="font2 content_top line40">
  				一档：
  			</div>
  			<input type="text" id="speed_1" name="speed_1" value="${relaySet.speed_1}"  class="content_top input">
  			<div class="font2 content_top line40">
  				%
  			</div>
  			</div>
  			<div class="content_top" style="width:45%;">
  			<div class="font2 content_top line40">
  				二档：
  			</div>
  			<input type="text" id="speed_2" name="speed_2" value="${relaySet.speed_2}"  class="content_top input">
  			<div class="font2 content_top line40">
  				%
  			</div>
  			</div>
  		</li>
  		<li class="line40">
  			<hr>
  		</li>
  		<li class="line40 margin-left1">
  			<div class="content_top" style="width:45%;">
  			<div class="font2 content_top line40">
  				三档：
  			</div>
  			<input type="text" id="speed_3" name="speed_3" value="${relaySet.speed_3}" class="content_top input">
  			<div class="font2 content_top line40">
  				%
  			</div>
  			</div>
  			<div class="content_top" style="width:45%;">
  			<div class="font2 content_top line40">
  				四档：
  			</div>
  			<input type="text" id="speed_4" name="speed_4" value="${relaySet.speed_4}" class="content_top input">
  			<div class="font2 content_top line40">
  				%
  			</div>
  			</div>
  		</li>
  		<li class="line80" >
  			<input type="button" value="保存" name="title" onclick="saveUpdate()" class="layui-btn"/>
  		</li>
  	</ul>
  	
  </div>
   <script type="text/javascript">
       function saveUpdate() {
           var id=$("#id").val();
           var relayId=$("#relayId").val();
           var monId=$("#monId").val();
           var type_1=$("#type_1").val();
           var num_1=$("#num_1").val();
           var speed_1=$("#speed_1").val();
           var type_2=$("#type_2").val();
           var num_2=$("#num_2").val();
           var speed_2=$("#speed_2").val();
           var type_3=$("#type_3").val();
           var num_3=$("#num_3").val();
           var speed_3=$("#speed_3").val();
           var type_4=$("#type_4").val();
           var num_4=$("#num_4").val();
           var speed_4=$("#speed_4").val();
           $.ajax({
               type: "POST",
               url: "/phone/updateRelaySet",
               data: {"id":id,"relayId":relayId,"monId":monId,"type_1":type_1,"num_1":num_1,"speed_1":speed_1,"type_2":type_2,"num_2":num_2,"speed_2":speed_2,"type_3":type_3,"num_3":num_3,"speed_3":speed_3,"type_4":type_4,"num_4":num_4,"speed_4":speed_4},
               success: function(result){
                   if(1==result.returnInfo.state){
                       window.location.reload();
                   }else{
                       alert(result.returnInfo.errorMsg);
                   }
               },
               error: function(result){
                   alert(result);
               }
           });
       }

       $(document).on('click', 'img',function (d) {
           d.preventDefault();
       });
   </script>
</body>

</html>
